<div class="container">
    <form method="post" class="form-x form-auto" action="{url()}">
        <div class="panel dux-box">
            <div class="panel-head">板块权限</div>
            <div class="panel-body">
                <div class="form-group">
                    <div class="label">板块</div>
                    <div class="field">
                        <input type="text" class="input" id="name" name="name" size="60" disabled value="{$info.name}">
                    </div>
                </div>
                <div class="form-group">
                    <div class="label">版主</div>
                    <div class="field">
                        <input type="text" class="input" id="manage" name="manage" size="60" placeholder="输入版主用户名" value="{$info.manage}">
                        <div class="input-note">版主可以对帖子进行管理等操作，请使用英文逗号分隔多个版主</div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="label">发帖积分</div>
                    <div class="field">
                        <input type="number" class="input" id="integral_add" name="integral_add" size="60" value="{$info.integral_add}">
                        <div class="input-note">发帖后用户获得的积分</div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="label">回帖积分</div>
                    <div class="field">
                        <input type="number" class="input" id="integral_reply" name="integral_reply" size="60" value="{$info.integral_reply}">
                        <div class="input-note">回帖后用户获得的积分</div>
                    </div>
                </div>
            </div>
            <table id="table" class="table table-hover thread-list">
                <tbody>
                    <tr>
                        <th width="10">
                            <input class="all" type="checkbox">
                        </th>
                        <th width="*">用户组</th>
                        <th width="*">浏览</th>
                        <th width="*">发帖</th>
                        <th width="*">回复</th>
                        <th width="*">附件上传</th>
                        <th width="*">附件下载</th>
                    </tr>
                    <!--if{!empty($groupList)}-->
                    <!--loop{$groupList as $vo}-->
                    <tr>
                        <td>
                            <input class="all-x" type="checkbox">
                        </td>
                        <td>{$vo.name}</td>
                        <td>
                            <input type="checkbox" name="purview[view][{$vo['group_id']}]" <!--if{$info['purview']['view'][$vo['group_id']]}--> checked <!--{/if}--> value="1">
                        </td>
                        <td>
                            <input type="checkbox" name="purview[push][{$vo['group_id']}]" <!--if{$info['purview']['push'][$vo['group_id']]}--> checked <!--{/if}--> value="1">
                        </td>
                        <td>
                            <input type="checkbox" name="purview[reply][{$vo['group_id']}]" <!--if{$info['purview']['reply'][$vo['group_id']]}--> checked <!--{/if}--> value="1">
                        </td>
                        <td>
                            <input type="checkbox" name="purview[upload][{$vo['group_id']}]" <!--if{$info['purview']['upload'][$vo['group_id']]}--> checked <!--{/if}--> value="1">
                        </td>
                        <td>
                            <input type="checkbox" name="purview[download][{$vo['group_id']}]" <!--if{$info['purview']['download'][$vo['group_id']]}--> checked <!--{/if}--> value="1">
                        </td>
                    </tr>
                    <!--{/loop}-->
                    <!--{/if}-->
                    <tr>
                        <td>
                            <input class="all-x" type="checkbox">
                        </td>
                        <td>游客</td>
                        <td>
                            <input type="checkbox" name="purview[view][0]" <!--if{$info['purview']['view'][0]}--> checked <!--{/if}--> value="1">
                        </td>
                        <td>
                            <input type="checkbox" disabled>
                        </td>
                        <td>
                            <input type="checkbox" disabled>
                        </td>
                        <td>
                            <input type="checkbox" disabled>
                        </td>
                        <td>
                            <input type="checkbox" name="purview[download][0]" <!--if{$info['purview']['download'][0]}--> checked <!--{/if}--> value="1">
                        </td>
                    </tr>
                </tbody>
            </table>
            <div class="panel-foot">
                <div id="tips"></div>
                <input type="hidden" name="plate_id" type="hidden" value="{$info.plate_id}">
                <button class="button bg-main" type="submit">保存</button>
                <button class="button bg" type="reset">重置</button>
            </div>
        </div>
    </form>
    <br>
</div>
<script>
    $(function(){
        $('.all').click(function(){
            $('input[type=checkbox]').prop('checked', $(this).prop('checked'));
        });
        $('.all-x').click(function(){
            $(this).parents('tr').find('input[type=checkbox]').prop('checked', $(this).prop('checked'));
        });
    });
</script>